package calculator;

/**
 * Provides cubic services to the <tt>calculator.service</tt> package.
 * @author Grant
 */
public class CubicFunctions {
    /**
     * Calculates the cube of its argument.
     * @param num the number to cube
     * @return the cube of <tt>num</tt>.
     */
    public static double cube(double num){
        return num * num * num;
    }
    
    /**
     * Calculates the cube root of its argument.
     * @param num the number for which to extract the cube root
     * @return the cube root of <tt>num</tt>.
     */
    public static double cubeRoot(double num) {
        double result = 1.0;
        for(int x = 1; x < 16; ++x){
            result = (num/(result * result)) + (2 * result)/3.0;
            System.out.println(result);
        }
        return result;
    }
}
